'''
Created on Mar 17, 2016

@author: JimmyMo
'''
OPER_DELETED = "deleted"
OPER_UPDATED = "updated"
OPER_ADDED = "added"

DEFAULT_PORTNAME = "_default"

def get_key(d):
    devicename = d['devicename']
    portname = __get_port_name(d, 'portname', '_default')
    key = "%s_%s" % (devicename, portname)
    return key

def __get_port_name(d, key, default_value):
    if key in d:
        cn = d[key]
    else:
        cn = default_value
    pass